package org.wzl.service.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.wzl.service.utils.JwtUtil;
import org.wzl.service.utils.Resp;

/**
 * @author: 卫志龙
 * @date: 2024年06月29日 09:15
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @GetMapping("/getJwt")
    public Resp<String> getJwt(String id, String username) {
        return Resp.ok(JwtUtil.jwt(id, username, JwtUtil.ExpirationTime.NO_README));
    }

    @GetMapping("/parseJwt")
    public Resp<JwtUtil.UserTokenBO> parseJwt(String jwt) {
        return Resp.ok(JwtUtil.parseJwt(jwt));
    }

}
